<template>
  <div class="page-wrap1">
    <Head title="密钥信息" isBack>
      <template #content>
        <Detail
          :columns="1"
          :form="detailForm"
          :detail="data.detailData"
          :labelWidth="100"
          align="left"
        ></Detail>
      </template>
    </Head>
  </div>
</template>
 
<script lang="ts" setup>
import Head from '@/components/head/index.vue';
import Detail from '@/components/form/detail.vue';
import { queryCecConfig } from '@/service/apis/docking';
import { queryDicByParent } from '@/service/apis/api';

const route = useRoute();
const {
  query: { id },
} = route;

const data = reactive({
  detailData: {} as any,
});

queryDicByParent({
  listDtos: ['cecOrgType'],
}).then((res: any) => {
  detailForm[0].dic = [...res.cecOrgType];
});

const detailForm = reactive([
  {
    label: '企业类型',
    prop: 'type',
    dic: [] as any,
  },
  {
    label: '企业名称',
    prop: 'orgName',
  },
  {
    label: '企业密钥',
    prop: 'orgKey',
  },
  {
    label: '消息密钥',
    prop: 'msgKey',
  },
  {
    label: '初始化向量',
    prop: 'initVector',
  },
  {
    label: '签名密钥',
    prop: 'signKey',
  },
  {
    label: '互联互通方接口url',
    prop: 'requestUrl',
  },
]);

queryCecConfig({ id }).then((res: any) => {
  if (res) {
    data.detailData = res;
  }
});
</script>
